package cn.qffj.memo.controller;

import cn.qffj.memo.domain.Img;
import cn.qffj.memo.repository.ImgRepository;
import org.hibernate.tuple.InMemoryValueGenerationStrategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.io.File;
import java.util.List;

/**
 * @author 杨友奇
 * @Time 2018/5/5
 */
@RestController
@RequestMapping("img")
public class ImgController {

    @Autowired
    private ImgRepository imgRepository;

    @PostMapping(value = "")
    public String photo(@Valid Img img) {


        img.setFile(img.getFile());
        imgRepository.save(img);

        return img.getFile();
    }
}
